Ubuntu JDK

  1. Remove default OpenJDK

    1
    sudo apt-get purge openjdk-\*
  2. download jdk(containing jre) and tar.

  3. add into /etc/profile

    1
    2
    JAVA_HOME="/home/newly/Program_Files/Java/jdk1.8.0_65"
    PATH="$PATH:$JAVA_HOME/jre/bin:$JAVA_HOME/bin"
  4. set newly installed jdk as default jdk.

    1
    2
    3
    sudo update-alternatives --install "/usr/bin/java" "java" "$JAVA_HOME/bin/java" 1
    sudo update-alternatives --install "/usr/bin/javac" "javac" "$JAVA_HOME/bin/javac" 1
    sudo update-alternatives --install "/usr/bin/javaws" "javaws" "$JAVA_HOME/bin/javaws" 1